package com.hmall.api.trade.fallback;

import com.hmall.api.trade.TradeClient;
import com.hmall.api.trade.po.Order;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;


/**
 * @author: wqy
 * @Date: 2025/09/04 16:12
 * @Description:
 */
@Slf4j
@Component
public class TradeClientFallbackFactory implements FallbackFactory<TradeClient> {
    @Override
    public TradeClient create(Throwable cause) {
        return new TradeClient() {
            @Override
            public void updateById(Order order) {
                log.error("远程调用TradeClient#updateById方法出现异常{}", cause.getMessage());
            }
        };
    }
}
